{{- if and .Site.Params.breadcrumb (default true .Params.breadcrumb) -}}
<nav class="row card component" aria-label="breadcrumb">
  <div class="card-body pb-0">
    <ol class="hbs-breadcrumb breadcrumb flex-nowrap">
      {{- template "breadcrumbnav" (dict "p1" . "p2" . "titleCase" $.Site.Params.titleCase) -}}
    </ol>
  </div>
</nav>
{{- end -}}
{{- define "breadcrumbnav" -}}
{{- if .p1.Parent -}}
{{- template "breadcrumbnav" (dict "p1" .p1.Parent "p2" .p2 )  -}}
{{- else if not .p1.IsHome -}}
{{- template "breadcrumbnav" (dict "p1" .p1.Site.Home "p2" .p2 )  -}}
{{- end -}}
{{- if eq .p1 .p2 -}}
<li class="breadcrumb-item active">{{ if .titleCase }}{{ title .p1.Title }}{{ else }}{{ .p1.Title }}{{ end }}</li>
{{- else -}}
<li class="breadcrumb-item text-surface"><a href="{{ .p1.RelPermalink }}">{{ if .p1.IsHome }}{{ i18n "home" }}{{ else }}{{ .p1.Title }}{{ end }}</a></li>
{{- end -}}
{{- end -}}

